<template>
  <div class="dashboard-container">
    <div class="dashboard-text">name: {{ name }}</div>
    <!-- <el-button @click="test">打印cookie</el-button> -->
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import cookie from 'js-cookie'
export default {
  name: '首页',
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  created(){
    this.$store.dispatch('user/login', this.loginForm).then(() => {
      this.$router.push({ path: this.redirect || '/' })
      
    }).catch(() => {
     
    })
  },
  methods:{
    test(){
      if(cookie.get("adminlist")){
        console.log('测试cookie：',cookie.get("adminlist"))
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
